import _ from "lodash";

class A {
  aaa;
  f1() {
    console.log("A.f1");
  }
}

console.log(Object.getOwnPropertyNames(A));

class B {
  f2() {
    console.log("B.f2");
  }
}

for (const name of Object.getOwnPropertyNames(A.prototype)) {
  if (name.startsWith("f")) {
    B.prototype[name] = A.prototype[name];
  }
}
// B.prototype.f1 = A.prototype.f1;
const b = new B();
b.f1(); // A.f1
b.f2(); // B.f2
class C extends B {
  f2() {
    console.log("C.f2");
  }
  f3() {
    console.log("C.f3");
  }
}
const c = new C();
b.f2(); // B.f2
c.f2(); // C.f2
c.f3(); // C.f3
